<?php
/** Function : dump()
 * Arguments : $data - the variable that must be displayed
 * Prints a array, an object or a scalar variable in an easy to view format.
 */
 
$debug = false;

function dump($data, $title = '') {
    if(is_array($data)) { //If the given variable is an array, print using the print_r function.
        print "<pre>-----------------------\n";
        if (! empty($title)) print $title . ":\n\n" ;
        print_r($data);
        print "-----------------------</pre>";
    } elseif (is_object($data)) {
        print "<pre>==========================\n";
        if (! empty($title)) print $title . ":\n\n" ;    
        var_dump($data);
        print "===========================</pre>";
    } else {
        print "<pre>";
        if (! empty($title)) print $title . ":\n\n" ;    
        
        var_dump($data);
        print "</pre>";
    }
} 
